Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use panic() instead of panic!() in some places in core. #92155

Merged
merged 2 commits into from
Dec 23, 2021

Conversation

m-ou-se
Copy link
Member

@m-ou-se m-ou-se commented Dec 21, 2021

See #92068 and #92140.

This avoids the panic!() macro in a few potentially hot paths. This becomes more relevant when switching core to Rust 2021, as it'll avoid format_args!() and save some compilation time. (It doesn't make a huge difference, but still.) (Also the errors in const panic become slightly nicer.)

@m-ou-se m-ou-se added the T-libs Relevant to the library team, which will review and decide on the PR/issue. label Dec 21, 2021
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Dec 21, 2021
@rust-highfive
Copy link
Collaborator

r? @kennytm

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 21, 2021
@m-ou-se
Copy link
Member Author

m-ou-se commented Dec 21, 2021

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 21, 2021
@bors
Copy link
Contributor

bors commented Dec 21, 2021

⌛ Trying commit ad6ef48 with merge 412eae87151e5669c0fabb73403ce60f665eff6b...

@bors
Copy link
Contributor

bors commented Dec 21, 2021

☀️ Try build successful - checks-actions
Build commit: 412eae87151e5669c0fabb73403ce60f665eff6b (412eae87151e5669c0fabb73403ce60f665eff6b)

@rust-timer
Copy link
Collaborator

Queued 412eae87151e5669c0fabb73403ce60f665eff6b with parent 87e8639, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (412eae87151e5669c0fabb73403ce60f665eff6b): comparison url.

Summary: This change led to moderate relevant mixed results 🤷 in compiler performance.

  • Moderate improvement in instruction counts (up to -1.1% on incr-unchanged builds of issue-88862)
  • Small regression in instruction counts (up to 1.8% on full builds of regression-31157)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Dec 21, 2021
@eddyb
Copy link
Member

eddyb commented Dec 21, 2021

Only one test regressed and it's in LLVM time (only with optimizations on), so if I had to guess, it's spending more time optimizing because it has more opportunities(?) or maybe it's just a spurious CGU reshuffle.

@m-ou-se
Copy link
Member Author

m-ou-se commented Dec 21, 2021

r? @eddyb

@rust-highfive rust-highfive assigned eddyb and unassigned kennytm Dec 21, 2021
@eddyb
Copy link
Member

eddyb commented Dec 21, 2021

I took another look and this is pretty telling:
image

To me that suggests that the -opt version of that test has been quite noisy for a while now, and yeah it turns out that it was started by #89836 and the noise isn't getting removed until rust-lang/rustc-perf#1127 is in use.
(EDIT: better link to the issue tracking the noise: rust-lang/rustc-perf#1126)

r=me whenever that is resolved and we can compare w/o the extra noise cc @Mark-Simulacrum

@Mark-Simulacrum
Copy link
Member

rust-lang/rustc-perf#1127 should be deployed, so new try builds should pick that up -- let's @bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 21, 2021
@bors
Copy link
Contributor

bors commented Dec 21, 2021

⌛ Trying commit ad6ef48 with merge 9ea815ce02d0627e5c079fa6cec343a2d1ecac66...

@bors
Copy link
Contributor

bors commented Dec 21, 2021

☀️ Try build successful - checks-actions
Build commit: 9ea815ce02d0627e5c079fa6cec343a2d1ecac66 (9ea815ce02d0627e5c079fa6cec343a2d1ecac66)

@rust-timer
Copy link
Collaborator

Queued 9ea815ce02d0627e5c079fa6cec343a2d1ecac66 with parent 8ad3c1d, future comparison URL.

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 22, 2021
@rust-log-analyzer

This comment has been minimized.

@m-ou-se
Copy link
Member Author

m-ou-se commented Dec 22, 2021

@bors r=eddyb

@bors
Copy link
Contributor

bors commented Dec 22, 2021

📌 Commit 22c4160 has been approved by eddyb

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 22, 2021
@bors
Copy link
Contributor

bors commented Dec 22, 2021

⌛ Testing commit 22c4160 with merge b994e3e57ed19e25954da3432746e403ffdf1544...

@ehuss
Copy link
Contributor

ehuss commented Dec 22, 2021

@bors treeclosed=100

Something seems wrong with the windows builders, this will likely fail.

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-msvc-1 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

failures:

---- process::tests::test_interior_nul_in_arg_is_error stdout ----
thread 'process::tests::test_interior_nul_in_arg_is_error' panicked at 'assertion failed: `(left == right)`
  left: `NotFound`,
 right: `InvalidInput`', library\std\src\process\tests.rs:309:19
---- process::tests::test_interior_nul_in_args_is_error stdout ----
thread 'process::tests::test_interior_nul_in_args_is_error' panicked at 'assertion failed: `(left == right)`
  left: `NotFound`,
  left: `NotFound`,
 right: `InvalidInput`', library\std\src\process\tests.rs:317:19
---- process::tests::test_interior_nul_in_current_dir_is_error stdout ----
thread 'process::tests::test_interior_nul_in_current_dir_is_error' panicked at 'assertion failed: `(left == right)`
  left: `NotFound`,
  left: `NotFound`,
 right: `InvalidInput`', library\std\src\process\tests.rs:325:19
---- sys::windows::process::tests::windows_exe_resolver stdout ----
---- sys::windows::process::tests::windows_exe_resolver stdout ----
thread 'sys::windows::process::tests::windows_exe_resolver' panicked at 'assertion failed: resolve_exe(OsStr::new(\"rustc\"), child_paths).is_ok()', library\std\src\sys\windows\process\tests.rs:174:5

failures:
    process::tests::test_interior_nul_in_arg_is_error
    process::tests::test_interior_nul_in_args_is_error
    process::tests::test_interior_nul_in_args_is_error
    process::tests::test_interior_nul_in_current_dir_is_error
    sys::windows::process::tests::windows_exe_resolver

test result: FAILED. 879 passed; 4 failed; 3 ignored; 0 measured; 0 filtered out; finished in 13.29s

error: test failed, to rerun pass '-p std --lib'


command did not execute successfully: "\\\\?\\D:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "test" "--target" "x86_64-pc-windows-msvc" "-Zbinary-dep-depinfo" "-j" "8" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace profiler compiler-builtins-c" "--manifest-path" "D:\\a\\rust\\rust\\library/test/Cargo.toml" "-p" "std" "--"


Build completed unsuccessfully in 0:42:48
Build completed unsuccessfully in 0:42:48
make: *** [Makefile:72: ci-subset-1] Error 1

@bors
Copy link
Contributor

bors commented Dec 22, 2021

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 22, 2021
@ehuss
Copy link
Contributor

ehuss commented Dec 22, 2021

@bors retry

Windows test_interior_nul issue

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 22, 2021
@ehuss
Copy link
Contributor

ehuss commented Dec 22, 2021

@bors treeclosed-

@bors
Copy link
Contributor

bors commented Dec 23, 2021

⌛ Testing commit 22c4160 with merge 390bb34...

@bors
Copy link
Contributor

bors commented Dec 23, 2021

☀️ Test successful - checks-actions
Approved by: eddyb
Pushing 390bb34 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 23, 2021
@bors bors merged commit 390bb34 into rust-lang:master Dec 23, 2021
@rustbot rustbot added this to the 1.59.0 milestone Dec 23, 2021
@m-ou-se m-ou-se deleted the panic-fn branch December 23, 2021 10:49
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (390bb34): comparison url.

Summary: This benchmark run did not return any relevant changes.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.